.class public Lcom/estrongs/android/ui/notification/b;
.super Ljava/lang/Object;
.source "ChromeCastPlayerNotificationHelper.java"

# interfaces
.implements Lcom/estrongs/chromecast/RemoteMediaPlayerListener;
.implements Lcom/estrongs/chromecast/ChromeCastConnectionListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/ui/notification/b$a;
    }
.end annotation


# static fields
.field private static d:Lcom/estrongs/android/ui/notification/b;


# instance fields
.field private a:Lcom/estrongs/chromecast/ChromeCastManager;

.field private b:Landroid/content/Context;

.field private c:Lcom/estrongs/android/ui/notification/c;


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    invoke-static {}, Lcom/estrongs/chromecast/ChromeCastManager;->getInstance()Lcom/estrongs/chromecast/ChromeCastManager;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    .line 3
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v0, 0x0

    .line 4
    iput-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v0, p0}, Lcom/estrongs/chromecast/ChromeCastManager;->addMediaPlayerListener(Lcom/estrongs/chromecast/RemoteMediaPlayerListener;)V

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v0, p0}, Lcom/estrongs/chromecast/ChromeCastManager;->addConnectionListener(Lcom/estrongs/chromecast/ChromeCastConnectionListener;)V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/b;
    .locals 0

    .line 1
    sput-object p0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    return-object p0
.end method

.method static synthetic b(Lcom/estrongs/android/ui/notification/b;)Lcom/estrongs/android/ui/notification/c;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    return-object p0
.end method

.method static synthetic j()Lcom/estrongs/android/ui/notification/b;
    .locals 1

    .line 1
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    return-object v0
.end method

.method public static k()Lcom/estrongs/android/ui/notification/b;
    .locals 1

    .line 1
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Lcom/estrongs/android/ui/notification/b;

    invoke-direct {v0}, Lcom/estrongs/android/ui/notification/b;-><init>()V

    sput-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    .line 3
    :cond_0
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 1

    .line 2
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    iget-object v0, v0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    if-eqz v0, :cond_0

    .line 3
    invoke-virtual {v0}, Lcom/estrongs/android/ui/notification/c;->a()V

    :cond_0
    return-void
.end method

.method public b()Landroid/app/PendingIntent;
    .locals 4

    .line 2
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.estrongs.action.chromecast.control.close"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 3
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    return-object v0
.end method

.method public c()Landroid/app/PendingIntent;
    .locals 4

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.estrongs.action.chromecast.control.disconnect"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    return-object v0
.end method

.method public d()Landroid/app/PendingIntent;
    .locals 4

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.estrongs.action.chromecast.control.next"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    return-object v0
.end method

.method public e()Landroid/app/PendingIntent;
    .locals 4

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.estrongs.action.chromecast.control.play"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    return-object v0
.end method

.method public f()Landroid/app/PendingIntent;
    .locals 4

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.estrongs.action.chromecast.control.preview"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    invoke-static {v1, v2, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    return-object v0
.end method

.method public g()Z
    .locals 1

    .line 1
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    iget-object v0, v0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Lcom/estrongs/android/ui/notification/c;->e()Z

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public h()V
    .locals 8

    .line 1
    new-instance v0, Landroid/widget/RemoteViews;

    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    const v2, 0x7f0c009a

    invoke-direct {v0, v1, v2}, Landroid/widget/RemoteViews;-><init>(Ljava/lang/String;I)V

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v1}, Lcom/estrongs/chromecast/ChromeCastManager;->getCurrentMediaInfo()Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;

    move-result-object v1

    if-nez v1, :cond_0

    return-void

    .line 3
    :cond_0
    iget-object v2, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->bitmap:Landroid/graphics/Bitmap;

    if-eqz v2, :cond_1

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v2

    if-nez v2, :cond_1

    .line 4
    iget-object v2, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->bitmap:Landroid/graphics/Bitmap;

    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const/high16 v4, 0x42800000    # 64.0f

    .line 5
    invoke-static {v3, v4}, Les/fy;->a(Landroid/content/Context;F)I

    move-result v3

    .line 6
    invoke-static {v2, v3}, Les/fy;->b(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;

    move-result-object v2

    const v3, 0x7f0906bc

    .line 7
    invoke-virtual {v0, v3, v2}, Landroid/widget/RemoteViews;->setImageViewBitmap(ILandroid/graphics/Bitmap;)V

    .line 8
    :cond_1
    iget-object v2, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v2}, Lcom/estrongs/android/util/n0;->z(Ljava/lang/String;)Z

    move-result v2

    const v3, 0x7f09004d

    const v4, 0x7f09004c

    const v5, 0x7f09004a

    const v6, 0x7f09004b

    if-eqz v2, :cond_2

    const/16 v2, 0x8

    .line 9
    invoke-virtual {v0, v5, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V

    .line 10
    invoke-virtual {v0, v6, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V

    .line 11
    invoke-virtual {v0, v4, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V

    .line 12
    invoke-virtual {v0, v3, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V

    :cond_2
    const v2, 0x7f09026a

    .line 13
    iget-object v7, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->name:Ljava/lang/String;

    invoke-virtual {v0, v2, v7}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

    .line 14
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->f()Landroid/app/PendingIntent;

    move-result-object v2

    invoke-virtual {v0, v5, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    .line 15
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->e()Landroid/app/PendingIntent;

    move-result-object v2

    invoke-virtual {v0, v6, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    .line 16
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->d()Landroid/app/PendingIntent;

    move-result-object v2

    invoke-virtual {v0, v4, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    .line 17
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->b()Landroid/app/PendingIntent;

    move-result-object v2

    invoke-virtual {v0, v3, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    const v2, 0x7f09004e

    .line 18
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->c()Landroid/app/PendingIntent;

    move-result-object v3

    invoke-virtual {v0, v2, v3}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    .line 19
    iget-object v2, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {v2}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaPlayerState()I

    move-result v2

    const/4 v3, 0x2

    if-ne v2, v3, :cond_3

    const v2, 0x7f0800ac

    .line 20
    invoke-virtual {v0, v6, v2}, Landroid/widget/RemoteViews;->setImageViewResource(II)V

    goto :goto_0

    :cond_3
    const v2, 0x7f0800ad

    .line 21
    invoke-virtual {v0, v6, v2}, Landroid/widget/RemoteViews;->setImageViewResource(II)V

    :goto_0
    const/4 v2, 0x0

    .line 22
    iget-object v3, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v3}, Lcom/estrongs/android/util/n0;->z(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_4

    .line 23
    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const-class v4, Lcom/estrongs/android/pop/app/PopAudioPlayer;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    goto :goto_1

    .line 24
    :cond_4
    iget-object v3, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v3}, Lcom/estrongs/android/util/n0;->Q(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_5

    .line 25
    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const-class v4, Lcom/estrongs/android/pop/app/PopVideoPlayer;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    goto :goto_1

    .line 26
    :cond_5
    iget-object v3, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v3}, Lcom/estrongs/android/util/n0;->k(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_6

    .line 27
    new-instance v2, Landroid/content/Intent;

    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    const-class v4, Lcom/estrongs/android/pop/app/PopAudioPlayer;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    :cond_6
    :goto_1
    if-eqz v2, :cond_b

    .line 28
    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    const/4 v4, 0x1

    if-eqz v3, :cond_7

    invoke-virtual {v3}, Lcom/estrongs/android/ui/notification/c;->d()Z

    move-result v3

    if-eqz v3, :cond_8

    .line 29
    :cond_7
    new-instance v3, Lcom/estrongs/android/ui/notification/c;

    iget-object v5, p0, Lcom/estrongs/android/ui/notification/b;->b:Landroid/content/Context;

    invoke-direct {v3, v5, v4}, Lcom/estrongs/android/ui/notification/c;-><init>(Landroid/content/Context;Z)V

    iput-object v3, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    .line 30
    :cond_8
    iget-object v3, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    invoke-virtual {v3, v0}, Lcom/estrongs/android/ui/notification/c;->a(Landroid/widget/RemoteViews;)V

    .line 31
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    invoke-virtual {v0, v4}, Lcom/estrongs/android/ui/notification/c;->b(Z)V

    .line 32
    iget-object v0, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->oriPath:Ljava/lang/String;

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-virtual {v2, v0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    const-string v0, "ChromecastNotification"

    .line 33
    invoke-virtual {v2, v0, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    const-string v0, "Chromecast"

    .line 34
    invoke-virtual {v2, v0, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 35
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    invoke-virtual {v0, v2, v4}, Lcom/estrongs/android/ui/notification/c;->b(Landroid/content/Intent;Z)V

    .line 36
    iget-object v0, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v0}, Lcom/estrongs/android/util/n0;->k(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_9

    .line 37
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    const v2, 0x7f0807b8

    invoke-virtual {v0, v2}, Lcom/estrongs/android/ui/notification/c;->a(I)V

    goto :goto_2

    .line 38
    :cond_9
    iget-object v0, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->url:Ljava/lang/String;

    invoke-static {v0}, Lcom/estrongs/android/util/n0;->Q(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_a

    .line 39
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    const v2, 0x7f0807c8

    invoke-virtual {v0, v2}, Lcom/estrongs/android/ui/notification/c;->a(I)V

    .line 40
    :cond_a
    :goto_2
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    iget-object v1, v1, Lcom/estrongs/chromecast/ChromeCastManager$MediaInfo;->name:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/estrongs/android/ui/notification/c;->c(Ljava/lang/CharSequence;)V

    .line 41
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    invoke-virtual {v0}, Lcom/estrongs/android/ui/notification/c;->g()V

    :cond_b
    return-void
.end method

.method public i()V
    .locals 0

    .line 1
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->h()V

    return-void
.end method

.method public onConnected()V
    .locals 0

    return-void
.end method

.method public onConnectionFailed()V
    .locals 0

    return-void
.end method

.method public onConnectionSuspended()V
    .locals 0

    return-void
.end method

.method public onDisconnected()V
    .locals 1

    .line 1
    sget-object v0, Lcom/estrongs/android/ui/notification/b;->d:Lcom/estrongs/android/ui/notification/b;

    iget-object v0, v0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Lcom/estrongs/android/ui/notification/c;->a()V

    :cond_0
    return-void
.end method

.method public onStatusUpdated(I)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/notification/b;->c:Lcom/estrongs/android/ui/notification/c;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lcom/estrongs/android/ui/notification/c;->e()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {p0}, Lcom/estrongs/android/ui/notification/b;->i()V

    :cond_0
    const/4 v0, 0x1

    if-ne p1, v0, :cond_1

    .line 3
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->getMediaIdleReason()I

    move-result p1

    if-ne p1, v0, :cond_1

    .line 4
    iget-object p1, p0, Lcom/estrongs/android/ui/notification/b;->a:Lcom/estrongs/chromecast/ChromeCastManager;

    invoke-virtual {p1}, Lcom/estrongs/chromecast/ChromeCastManager;->mediaPlayNext()V

    :cond_1
    return-void
.end method
